<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head th:replace="/layout :: htmlhead" th:with="title='后台管理'">
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <h2><b>资源列表</b></h2>
                </div>
                <div class="layui-card-body">
                    <table class="layui-hide" id="table" lay-filter="table"></table>

                    <script type="text/html" id="islock">
                        {{#  if(d.status == 0){ }}
                        <input type="checkbox" name="{{d.name}}" value="{{d.id}}" lay-skin="switch"
                               lay-text="启用|停用"
                               lay-filter="islock" checked="checked"/>
                        {{#  } else { }}
                        <input type="checkbox" name="{{d.name}}" value="{{d.id}}" lay-skin="switch"
                               lay-text="启用|停用"
                               lay-filter="islock"/>
                        {{#  } }}
                    </script>

                    <script type="text/html" id="isMenu">
                        {{#  if(d.resourcetype == 0){ }}
                        菜单
                        {{#  } else { }}
                        按钮
                        {{#  } }}
                    </script>

                    <script type="text/html" id="isPolice">
                        {{#  if(d.ispolice == 0){ }}
                        否
                        {{#  } else { }}
                        是
                        {{#  } }}
                    </script>

                    <script type="text/html" id="isGroup">
                        {{#  if(d.regroup == 0){ }}
                        通用模块
                        {{#  } else if(d.regroup == 1){ }}
                        系统管理
                        {{#  } else if(d.regroup == 2){ }}
                        业务管理
                        {{#  } else if(d.regroup == 3){ }}
                        审计管理
                        {{#  } else if(d.regroup == 4){ }}
                        安全管理
                        {{#  } }}
                    </script>
                    <script type="text/html" id="table-toolbar">
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="add"
                           shiro:hasPermission="resource:add">新建</a>
                        <a class="layui-btn layui-btn-xs" lay-event="edit" shiro:hasPermission="resource:edit">编辑</a>
                        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"
                           shiro:hasPermission="resource:del">删除</a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="resourceEdit" class="layer_self_wrap" style="display:none;">
    <form id="resourceForm" lay-filter="resourceForm" class="layui-form layui-form-pane" method="post"
          style="margin-top: 20px;" action="">
        <input name="id" type="hidden"/>
        <input name="pid" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label">资源名称</label>
            <div class="layui-input-inline">
                <input name="name" autocomplete="off" class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源地址</label>
            <div class="layui-input-inline">
                <input name="url" autocomplete="off" class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">代码值</label>
            <div class="layui-input-inline">
                <select name="resourcetype">
                    <option value="0">菜单</option>
                    <option value="1">按钮</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">警员资源</label>
            <div class="layui-input-inline">
                <select name="ispolice">
                    <option value="0">否</option>
                    <option value="1">是</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">核心功能</label>
            <div class="layui-input-inline">
                <select name="iscore">
                    <option value="0">否</option>
                    <option value="1">是</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">非常规业务</label>
            <div class="layui-input-inline">
                <select name="isnormal">
                    <option value="0">否</option>
                    <option value="1">是</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源简介</label>
            <div class="layui-input-inline">
                <input name="description" autocomplete="off" class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图标</label>
            <div class="layui-input-inline">
                <input name="icon" autocomplete="off" class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-inline">
                <input name="seq" autocomplete="off" class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源分组</label>
            <div class="layui-input-inline">
                <select name="regroup">
                    <option value="1">系统管理</option>
                    <option value="2">业务管理</option>
                    <option value="3">审计管理</option>
                    <option value="4">安全管理</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">代码值</label>
            <div class="layui-input-inline">
                <input name="code" autocomplete="off" class="layui-input" type="text"/>
            </div>
        </div>
    </form>
</div>

<script th:src="@{/js/configManager/resource.js}"></script>
</body>
</html>